import { service as request, BasePath } from '../request'

/**
  * 获取所有示范区
  * @returns {Object} Promise
  */
export const getAreaByAll = () => request({
  url: `${BasePath}/demonstration/all`,
  method: 'GET'
})

/**
  * 删除所选示范区
  * @returns {Object} Promise
  */
export const delAreaByID = (ids) => request({
  url: `${BasePath}/demonstration/${ids}`,
  method: 'DELETE'
})

/**
  * 创建示范区
  * @returns {Object} Promise
  */
export const createArea = (data) => request({
  url: `${BasePath}/demonstration`,
  method: 'POST',
  data
})

/**
  * 修改示范区
  * @returns {Object} Promise
  */
export const editArea = (data) => request({
  url: `${BasePath}/demonstration`,
  method: 'PUT',
  data
})

/**
 * 添加服务
 * @returns {Object} Promise
 */
export const createService = (data) => request({
  url: `${BasePath}/demonstrationServer`,
  method: 'POST',
  data
})

/**
  * 编辑服务
  * @returns {Object} Promise
  */
export const editService = (data) => request({
  url: `${BasePath}/demonstrationServer`,
  method: 'PUT',
  data
})
